<template>
  <el-collapse-item key="picEffect" title="图片特效" name="picEffect">
    <el-form label-width="70px">
      <el-form-item label="图片显示">
        <el-radio-group v-model="curComponent.picScaleType">
          <el-radio :label="1">自适应</el-radio>
          <el-radio :label="0">填充</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="图片显示">
        <el-select v-model="curComponent.rotation">
          <el-option
            v-for="(item, index) in rotationOption"
            :key="index"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="进场特效">
        <el-select v-model="curComponent.picStyleIn">
          <el-option
            v-for="(item, index) in picStyleInOptions"
            :key="index"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="进场时长">
        <el-input v-model="curComponent.picStyleInTime" @change="changePageTotalTime">
          <template slot="append">*0.1秒</template></el-input
        >
      </el-form-item>
      <el-form-item label="出场特效">
        <el-select v-model="curComponent.picStyleOut">
          <el-option
            v-for="(item, index) in picStyleInOptions"
            :key="index"
            :label="item.label"
            :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="出场时长">
        <el-input v-model="curComponent.picStyleOutTime" @change="changePageTotalTime">
          <template slot="append">*0.1秒</template></el-input
        >
      </el-form-item>
    </el-form>
  </el-collapse-item>
</template>

<script>
import {
  textAlignOptions,
  borderStyleOptions,
  verticalAlignOptions,
  selectKey,
  optionMap,
  rotationOption,
  picStyleInOptions,
} from '@/utils/attr'

export default {
  name: 'PicEffectAttr',
  data() {
    return {
      optionMap,
      textAlignOptions,
      borderStyleOptions,
      verticalAlignOptions,
      selectKey,
      activeName: '',
      rotationOption,
      picStyleInOptions,
    }
  },
  computed: {
    curComponent() {
      return this.$store.state.curComponent
    },
  },
  methods: {
    changePageTotalTime() {
      this.$store.commit('setPageTotalTime')
    },
  },
}
</script>

<style lang="scss" scoped></style>
